function y = e_freroth(x)
% Extended Freudenstein & Roth function
%x0=[0.5,-2,...0.5.....-2]
%fmin=n/2
%Author:shi yangyang
n=length(x);
m=n/2;
y=ones(1,m);
for i=1:1:m
    t1=-13.0+x(2*i-1)+5.0*x(2*i)*x(2*i)-x(2*i)^3-2*x(2*i);
    t2=-29.0+x(2*i-1)+x(2*i)^3+x(2*i)^2-14.0*x(2*i);
    y(i)=t1*t1+t2*t2;
end
y=sum(y);
